home *** CD-ROM | disk | FTP | other *** search
- Path: news.uh.edu!usenet
- From: Sensarn <txs53132@bayou.uh.edu>
- Newsgroups: comp.lang.c++
- Subject: Re: help with vga
- Date: 25 Jan 1996 22:47:07 GMT
- Organization: AEtna Insurance Agency
- Message-ID: <4e919b$i36@masala.cc.uh.edu>
- References: <4e8v31$p9d@ixnews7.ix.netcom.com>
- NNTP-Posting-Host: sip-14308.public-dialups.uh.edu
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1 (Windows; U; 16bit)
-
- Here's how to switch to mode 13h (good for simple graphics):
-
- //AX=SCREEN MODE (IN THIS CASE -- 0X13)
- //INT 0X10
-
- asm {
- mov ax,0x13
- int 0x10
- }
-
- Okay. Now here is a function to plot a pixel:
-
- //You need a pointer for access to the video buffer
- unsigned char far *video_buffer=(unsigned char far *)0xA0000000;
-
- void pixel(int x,int y,int color)
- {
- //Uses shifting for speed (Andre LaMothe taught me that)
- //y<<8 = y * 256 and y<<6 = y * 64 -- 256 + 64 = 320
- video_buffer[(y<<8)+(y<<6)+x]=color;
- }
-
-
- Steven Sensarn - txs53132@bayou.uh.edu
-
-
-